﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="Order.aspx.cs"
    Inherits="TCKQKL.FrontEnd.Web.Order" %>

<%@ Register Src="Controls/OrderPlace.ascx" TagName="OrderPlace" TagPrefix="uc1" %>
<%@ Register Src="Controls/OrderConfirm.ascx" TagName="OrderConfirm" TagPrefix="uc2" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="Controls/OrderList.ascx" TagName="OrderList" TagPrefix="uc3" %>
<%@ Register Src="Controls/CashInfo.ascx" TagName="CashInfo" TagPrefix="uc4" %>
<%@ Register Src="Controls/StocksInfo.ascx" TagName="StocksInfo" TagPrefix="uc5" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackErrorMessage="Kết nõi tới IRS đã bị ngắt. Bấm F5 để thử lại.">
    </asp:ScriptManager>
    <table style="width: 100%;">
        <tr>
            <td style="vertical-align: top;">
                <table class="data" style="border: none; width: 170px;">
                    <tr>
                        <th style="text-align: left; padding-left: 5px">
                            TIỆN ÍCH
                        </th>
                    </tr>
                    <tr>
                        <td>
                            <asp:LinkButton ID="lbBuy" runat="server" OnClick="lbBuy_Click">Mua</asp:LinkButton>
                            &nbsp; | &nbsp;
                            <asp:LinkButton ID="lbSell" runat="server" OnClick="lbSell_Click">Bán</asp:LinkButton>
                            &nbsp; | &nbsp;
                            <asp:LinkButton ID="lbChange" runat="server" OnClick="lbChange_Click">Sửa</asp:LinkButton>
                            &nbsp; | &nbsp;
                            <asp:LinkButton ID="lbCancel" runat="server" OnClick="lbCancel_Click">Huỷ</asp:LinkButton>
                        </td>
                    </tr>
                </table>
                <br />
                <uc4:CashInfo ID="CashInfo1" runat="server" />
                <br />
                <uc5:StocksInfo ID="StocksInfo1" runat="server" />
            </td>
            <td id="middle" style="width: 100%; vertical-align: top;">
                <table cellpadding="0" cellspacing="0" style="width: 100%;">
                    <tr>
                        <td>
                            <asp:UpdatePanel ID="pnlOrderList" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <% if (orderList != null)
                                       {%>
                                    <asp:DataList ID="rptOrders" runat="server" Width="100%" RepeatColumns="0" RepeatLayout="Flow"
                                        RepeatDirection="Horizontal" AlternatingItemStyle-BackColor="#CCCCCC" OnItemCommand="rptOrders_ItemCommand">
                                        <HeaderTemplate>
                                            <table class="data" style="border: none;">
                                                <tr>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        &nbsp; Huỷ
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Bên
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Mã CK
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Loại
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        KL
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Giá
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Thời gian
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Trạng thái
                                                    </th>
                                                    <th class="InnerHeading" style="text-align: left;">
                                                        Sửa
                                                    </th>
                                                </tr>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    <asp:CheckBox ID="matched" runat="server" />
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblOrderSide" runat="server" Text='<%# Eval("OrderSide") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblSymbol" runat="server" Text='<%# Eval("Symbol") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblOrderClass" runat="server" Text='<%# Eval("OrderClass") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblTimeStamp" runat="server" Text='<%# Eval("TimeStamp") %>'></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblOrderNo" runat="server" Text='<%# (Eval("OrderNo")=="")?"CHỜ XỬ LÝ":Eval("OrderNo") %>'>&nbsp;</asp:Label>
                                                </td>
                                                <td>
                                                    <asp:ImageButton ImageUrl="./images/edit_icon.gif" runat="server" ID="btnDelete"
                                                        CommandName="Change" CommandArgument='<%# Eval("OrderId").ToString() %>' OnClientClick="return confirm('Bạn có chắc muốn sửa lệnh này?');" />
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <tr>
                                                <td colspan="10" style="text-align: right; border-bottom: none;">
                                                    <asp:Button ID="btnCancel" runat="server" Text="Huỷ lệnh" OnClick="btnCancel_Click"
                                                        OnClientClick="return confirm('Bạn có chắc muốn huỷ lệnh này?');" />
                                                </td>
                                            </tr>
                                            </table>
                                        </FooterTemplate>
                                    </asp:DataList><%} %>
                                    <asp:Timer ID="tmRefreshList" runat="server" OnTick="tmRefreshList_Tick" Interval="30000">
                                    </asp:Timer>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Wizard ID="wzdOrder" runat="server" ActiveStepIndex="0" OnFinishButtonClick="wzdOrder_FinishButtonClick"
                                FinishCompleteButtonText="Kết thúc đặt lệnh" FinishPreviousButtonText="Đặt thêm lệnh"
                                StartNextButtonText="Đặt lệnh" StepNextButtonText="Kết thúc" Width="100%" OnActiveStepChanged="wzdOrder_ActiveStepChanged"
                                DisplaySideBar="False" OnNextButtonClick="wzdOrder_NextButtonClick" StepPreviousButtonText="Đặt thêm">
                                <WizardSteps>
                                    <asp:WizardStep ID="stPlace" runat="server" Title="Đặt lệnh" StepType="Start">
                                        <uc1:OrderPlace ID="ucOrderUI" runat="server" />
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="stComplete" runat="server" StepType="Finish" Title="Xác nhận">
                                        <uc2:OrderConfirm ID="ucOrderConfim" runat="server" />
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="stOrderList" StepType="Step" runat="server">
                                    </asp:WizardStep>
                                </WizardSteps>
                            </asp:Wizard>
                            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                                <ProgressTemplate>
                                    <asp:Label ID="Label2" runat="server" CssClass="progresLable">Đang kết nối tới IRS, xin vui lòng đợi...</asp:Label>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
